

export default () => {
    // 中文数字映射
    const chineseToNumberMap = {
        '零': '0',
        '〇': '0',
        '一': '1',
        '二': '2',
        '三': '3',
        '四': '4',
        '五': '5',
        '六': '6',
        '七': '7',
        '八': '8',
        '九': '9',
        '十': '10'
    };
    const convertNumber = (str) => {
        if (!str) return str
        str = str + ''
        str = str.replace(/[一二三四五六七八九〇]/g, (match) => chineseToNumberMap[match])
        return str
    }
    return {
        convertNumber
    }
}